package com.asset.salesforce.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.LoginDaoImpl;
import com.asset.salesforce.domain.Login;

@Service
@Transactional(readOnly = true)
public class LoginService {
	
	@Autowired 
	private LoginDaoImpl loginDaoImpl;
	
	@Transactional(readOnly=false)
	public void addLogin(Login login) {
		loginDaoImpl.addLogin(login);
	}
	
	@Transactional(readOnly=false)
	public void saveOrUpdate(Login login){
		loginDaoImpl.saveOrUpdateLogin(login);
	}
	
	public Login  getLogin(String password,String email) {
		  Login login  = loginDaoImpl.getLogin(email, password);
		return login;
	}
	
	public Login getLoginById(Integer empId) {
		return loginDaoImpl.getLoginById(empId);
	}
	

}
